home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / systems / mac / euro-oztex / EOT2.1#2.sea.bin / PS-files / getinfo.ps < prev    next >
Text File  |  1992-03-03  |  3KB  |  130 lines

  1. %!
  2. % Returns device info to host.
  3.  
  4. initgraphics
  5.  
  6. /newline {
  7.   (\r) print flush             % send carriage return
  8. } def
  9.  
  10. /s40 { 40 string } def
  11.  
  12. statusdict begin
  13.    9  sccbatch                 % baud options (for 9-pin serial channel)
  14.    25 sccbatch                 % baud options (for 25-pin serial channel)
  15.    revision                    % int
  16.    product dup                 % string
  17.    (Linotype) eq
  18.    { userdiskpercent           % percent
  19.      diskstatus                % free total
  20.      resolution                % int
  21.      true                      % we are running on a Linotronic
  22.    }
  23.    { false                     % we are running on some other device
  24.    } ifelse
  25. end
  26.  
  27. % true or false currently on top of stack
  28.  
  29. { (RESOLUTION  = ) print s40 cvs print newline
  30.   (DISK STATUS = ) print s40 cvs print
  31.   ( )              print s40 cvs print newline
  32.   (USER DISK % = ) print s40 cvs print newline
  33. } if
  34.  
  35. (PRODUCT  = ) print print newline
  36. (REVISION = ) print s40 cvs print newline
  37. (VERSION  = ) print version print newline
  38.  
  39. newline
  40. (CHANNEL 25  = ) print s40 cvs print
  41. ( )              print s40 cvs print newline
  42. (CHANNEL 9   = ) print s40 cvs print
  43. ( )              print s40 cvs print newline
  44.  
  45. version cvr 25.0 gt            % PS version >= 25.0 ?
  46. {
  47.   newline
  48.   currentpacking               % bool
  49.   (CURRENT PACKING = ) print
  50.   s40 cvs print newline
  51.  
  52.   newline
  53.   currentcacheparams           % mark lower upper
  54.   (CURRENT CACHE PARAMS) print newline
  55.   counttomark
  56.      { s40 cvs print newline }
  57.   repeat
  58.   pop                          % remove mark
  59. } if
  60.  
  61. newline
  62. (CACHE STATUS) print newline
  63. cachestatus                    % bsize bmax msize mmax csize cmax blimit
  64. (blimit = ) print s40 cvs print newline
  65. (cmax   = ) print s40 cvs print newline
  66. (csize  = ) print s40 cvs print newline
  67. (mmax   = ) print s40 cvs print newline
  68. (msize  = ) print s40 cvs print newline
  69. (bmax   = ) print s40 cvs print newline
  70. (bsize  = ) print s40 cvs print newline
  71.  
  72. newline
  73. (VM STATUS) print newline
  74. vmstatus                       % savelevel vmused vmmax
  75. (vm max     = ) print s40 cvs print newline
  76. (vm used    = ) print s40 cvs print newline
  77. (save level = ) print s40 cvs print newline
  78.  
  79. newline
  80. (DEFAULT MATRIX = ) print
  81. matrix defaultmatrix           % [ ? ? ? ? ? ? ]
  82. dup 0 get s40 cvs print ( ) print
  83. dup 1 get s40 cvs print ( ) print
  84. dup 2 get s40 cvs print ( ) print
  85. dup 3 get s40 cvs print ( ) print
  86. dup 4 get s40 cvs print ( ) print
  87. dup 5 get s40 cvs print ( ) print
  88. newline
  89. pop
  90.  
  91. /res 300 def
  92. /oshift -10.7 def
  93.  
  94. % switch to TeX portrait coordinate system:
  95.  
  96. initgraphics
  97. 72 res div dup neg scale                % units now device dots
  98. res oshift res mul translate            % move to TeX origin
  99.  
  100. newline
  101. (TeX PORTRAIT MATRIX = ) print
  102. matrix currentmatrix                  % [ ? ? ? ? ? ? ]
  103. dup 0 get s40 cvs print ( ) print
  104. dup 1 get s40 cvs print ( ) print
  105. dup 2 get s40 cvs print ( ) print
  106. dup 3 get s40 cvs print ( ) print
  107. dup 4 get s40 cvs print ( ) print
  108. dup 5 get s40 cvs print ( ) print
  109. newline
  110. pop
  111.  
  112. % switch to TeX landscape coordinate system:
  113.  
  114. initgraphics
  115. 90 rotate                                    % rotate axes 90deg anticlockwise
  116. 72 res div dup neg scale                % units now device dots
  117. res dup translate                            % move to TeX origin
  118.  
  119. newline
  120. (TeX LANDSCAPE MATRIX = ) print
  121. matrix currentmatrix                   % [ ? ? ? ? ? ? ]
  122. dup 0 get s40 cvs print ( ) print
  123. dup 1 get s40 cvs print ( ) print
  124. dup 2 get s40 cvs print ( ) print
  125. dup 3 get s40 cvs print ( ) print
  126. dup 4 get s40 cvs print ( ) print
  127. dup 5 get s40 cvs print ( ) print
  128. newline
  129. pop
  130.